#pragma once

#include<stdio.h>
#include<string.h>

#define N 50
#define M 2 * N - 1

typedef struct HuffmanNode
{
	char data[5];
	int weight;
	int parent;
	int leftchild;
	int rightchild;
}HTNode;
typedef struct HuffmanCode
{
	char cd[N];
	int start;
}HTCode;

void CreateHT(HTNode ht[], int n);
void CreateHCode(HTNode ht[], HTCode hcd[], int n);
void DispHCode(HTNode ht[], HTCode hcd[], int n);